package com.ljw.punishment.mvelcondition;

import org.apache.commons.lang3.StringUtils;
import org.jeasy.rules.api.Facts;

import java.io.Serializable;

/**
 * @author lijunwei
 * @date 2025/5/21
 */
public class CustomStrAction implements CustomAction, Serializable {

    private static final long serialVersionUID = 681284393873511782L;

    private final String expression;

    public CustomStrAction(String expression) {
        this.expression = expression;
    }

    @Override
    public String execute(Facts facts) throws Exception {
        if (StringUtils.isBlank(expression)) {
            return null;
        }
        return expression;
    }

}
